import { isFunction, isObject } from '../is'

export function objectMapTrans(obj, callback) {
  if (!isObject(obj)) {
    throw Error(`${obj} is not object, objectMapTrans's first param need a object`)
  }

  if (!isFunction(callback)) {
    throw Error(`${callback} is not function, objectMapTrans's second param need a function`)
  }

  return Object.keys(obj).map((k) => callback(k))
}
